home *** CD-ROM | disk | FTP | other *** search
/ Wonky Flux Batch 2019 02 / Wonky_Flux_Batch_2019-02.zip / Wonky Flux Batch 2019-02 / 075 - Clash of Arms.dsk / WAR.SYSOP.SEG.S < prev   
Text File  |  2019-02-17  |  7KB  |  202 lines

  1.                          ;     *****************
  2.                          ;    **               **
  3.                          ;    *  Clash of Arms  *
  4.                          ;    *    Sysop Seg    *
  5.                          ;    **               **
  6.                          ;     *****************
  7.  
  8.           public BeginGame
  9.  
  10.           on nocar goto HungUp
  11.           goto SysopMenu
  12.  
  13. HungUp
  14.           link "a:war.start","termgame"
  15.  
  16. BeginGame
  17.                          ; from war.start.s
  18.           gosub StartGame
  19.           gp=gn:gn=0
  20.           link "a:war.start","MainCommand"
  21.  
  22.  
  23.  
  24. SysopMenu
  25.           input \"Sysop Command (?=Help): ";ka$
  26.           if ka$="?" print '
  27.             ------------------------
  28.                   Sysop`s Menu
  29.             ------------------------
  30.              C: Create Game File
  31.              F: Create/Reset Files
  32.  
  33.              S: Start a Game
  34.              D: Delete a Game
  35.  
  36.              A: Add Item to News
  37.  
  38.              Q: Quit
  39.             ------------------------'
  40.           if ka$="A" print \"Add news item:"\date$;:input @3 ": ";km$
  41.           if (ka$="A") and (len(km$)<1) print \"Aborted":goto SysopMenu
  42.           if ka$="A" open #1,dr$+"war.news":append #1:print #1,date$;": ";km$:close
  43.           if ka$="C" goto CreateFile
  44.           if ka$="S" gosub GetGame:gosub StartGame:goto SysopMenu
  45.           if ka$="D" gosub GetGame:gosub DeleteGame
  46.           if ka$="F" goto CrtDlt
  47.           if ka$="Q" link "a:war.start","MainCommand"
  48.           goto SysopMenu
  49.  
  50. CreateFile
  51.           input \"Game Number (?=List): ";gn$:gn=val(gn$)
  52.           if gn$ = "?" gosub ListGames:goto CreateFile
  53.           if (gn=0) and (gn$<>"0") print \"Try again...":goto CreateFile
  54.           if gn=0 goto SysopMenu
  55.  
  56.           kill dr$+"GAME.DATA."+gn$:create dr$+"GAME.DATA."+gn$
  57.           open #1,dr$+"GAME.DATA."+gn$
  58.  
  59.           for ka = 1 to 6
  60. GetUsrNumber
  61.           print \"User number of Player #";ka;": ";
  62.           input kb
  63.           open #2,"b:users":position #2,128,kb:input #2,ka$,ka$:input #2,kn$:close #2
  64.           if len(kn$)<1 goto GetUsrNumber
  65.           position #1,1,(ka-1)*25:print #1 kn$
  66.           print kn$"? (Y/[N]) ";:input @2 ka$
  67.           if ka$<>"Y" goto GetUsrNumber
  68.           open #2,dr$+"war.master"
  69.           position #2,35,(gn-1),(ka-1)*5:print #2,kb
  70.           if ka=6 position #2,35,(gn-1),30:print #2,0
  71.                          ; set game to "not currently playing" on the last time thru loop
  72.           close #2
  73.           next
  74.  
  75.           print "Creating files.";
  76.  
  77.           for ka = 150 to 200 step 10
  78.           position #1,1,ka:print #1,date$
  79.           next
  80.  
  81.           for ka = 210 to 295 step 5
  82.           position #1,1,ka:print #1,0
  83.           next
  84.  
  85.           position #1,1,300:print #1,12
  86.           position #1,1,305:print #1,12
  87.  
  88.           for ka= 310 to 325 step 5
  89.           position #1,1,ka:print #1,4
  90.           next
  91.  
  92.           close
  93.           print "."      ;
  94.  
  95. NewGameFiles
  96.           kill dr$+"attacks."+gn$:create dr$+"attacks."+gn$:open #1,dr$+"attacks."+gn$
  97.           for p1=0 to 5
  98.           for p2=0 to 5
  99.           position #1,60,p1,10*p2:print #1,0
  100.           position #1,60,p1,(10*p2)+5:print #1,0
  101.           next
  102.           next
  103.           close
  104.  
  105.           kill dr$+"war.map1."+gn$:create dr$+"war.map1."+gn$
  106.           open #1,dr$+"war.map1":open #2,dr$+"war.map1."+gn$:copy #1,#2:close
  107.           print "."      ;
  108.  
  109.           kill dr$+"war.map2."+gn$:create dr$+"war.map2."+gn$
  110.           open #1,dr$+"war.map2":open #2,dr$+"war.map2."+gn$:copy #1,#2:close
  111.           print "."
  112.           return
  113.  
  114.           goto SysopMenu
  115.  
  116. CrtDlt
  117.           input @2 \"M)aster file, N)ews file, H)all of Fame, T)op Score: ";ka$
  118.           if ka$="M" kill dr$+"war.master":create dr$+"war.master":print \"Created"
  119.           if ka$="N" kill dr$+"war.news":create dr$+"war.news":print \"Created"
  120.           if ka$="H" kill dr$+"war.fame":create dr$+"war.fame":print \"Created"
  121.           if ka$="T" kill dr$+"top.score":create dr$+"top.score":close:open #1,dr$+"top.score":print #1,"No Conquerors":print #1,0:print \"Created":close
  122.           goto SysopMenu
  123.  
  124. GetGame
  125.           input \"Game Number (?=List): ";GN$
  126.           if gn$="?" gosub ListGames:goto GetGame
  127.           gn=val(gn$)
  128.           if gn=0 gn$="0":print "- Aborted -":return
  129.           open #1,dr$+"war.master":position #1,35,(gn-1):input #1 ka$:close
  130.           if val(ka$)=0 and (ka$<>"0") print \"That game is not being played right now.":goto GetGame
  131.           return
  132.  
  133. DeleteGame
  134.           open #1,dr$+"war.master"
  135.           position #1,35,(gn-1),30:print #1,0
  136.           position #1,35,(gn-1),0:print #1,"D"
  137.           close
  138.           for pn=1 to 6:gosub RemovePlayer:next
  139.           return
  140.  
  141. RemovePlayer
  142.           open #1,dr$+"war.master"
  143.           position #1,35,gn-1,(pn-1)*5:print #1,0
  144.           close
  145.           return
  146.  
  147. StartGame
  148.           open #1,dr$+"WAR.MASTER"
  149.           for ka = 1 to 6
  150.           position #1,35,(gn-1),(ka-1)*5:input #1,kb
  151.           if kb=0 goto PastMail
  152.  
  153. MailUsers
  154.           d=kb
  155.           edit(0)
  156.           print #8,"Clash of Arms Notification:"
  157.           print #8,""
  158.           print #8,"As of "date$" "time$" enough players have entered the game."
  159.           print #8,"You may begin play, in game #"gn"!"
  160.           print #8,""
  161.           ready "g:mail"
  162.           if info(6)<29 print \"Mail bit-map full":return
  163.           print #msg(d),un
  164.           print #6,"Subj: Clash of Arms"
  165.           print #6,"From: War Command Headquarters"
  166.           copy #8,#6:print #msg(d),chr$(4);chr$(0);
  167.           msg(d)=msg(d)+1:update
  168.  
  169. PastMail
  170.           next
  171.           position #1,35,(gn-1),30:print #1,1
  172.           close
  173.           open #1,dr$+"game.data."+str$(gn)
  174.           for ka = 0 to 5
  175.           position #1,1,150+(ka*10)
  176.           print #1,left$(date$,3);
  177.           print #1,right$("0"+ str$(val(mid$(date$,4,2))-1),2);right$(date$,3)
  178.           next
  179.           close:return
  180.  
  181. ListGames
  182.           print '
  183. #            # of players In Progress
  184. ----      ------------ -----------'
  185.           open #1,dr$+"war.master"
  186.           ka=1
  187. ListLoop
  188.           kc=0
  189.           for kb = 1 to 6
  190.           position #1,35,ka-1,(kb-1)*5:input #1,ka$
  191.           if (val(ka$)=0) and (ka$<>"0") and (ka$<>"D") ka=0
  192.           if ka$="D" kc=7
  193.           if val(ka$) > 0 kc=kc+1
  194.           next
  195.           if kc>6 kc=0
  196.           if ka=0 close:return
  197.           if kc print left$(str$(ka)+"     ",5);kc;"            ";
  198.           position #1,35,(ka-1),30:input #1,kd
  199.           if kc=0 ka=ka+1:goto ListLoop
  200.           if kd=0 print "No":else print "Yes"
  201.           ka=ka+1:goto ListLoop
  202.